﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GMaps
{
    public class GEvent
    {       
        public GElement Element { get; set; }
        public GEventType Type { get; set; }
        public string HandlerCode { get; set; }


        public GEvent(GElement element, GEventType type)
        {
            Element = element;
            Type = type;
        }

        public string Render()
        {
            string script = "google.maps.event.addListener("+Element.ID +", "+Type.Event+", function(event) {";

            script += HandlerCode;

            script += "});";
            return script; 
        }
    }

    public class GEventType 
    {
        public string  Event { get; set; }
        private GEventType() { }
        internal  GEventType(string pevent)
        {
            Event = pevent;
        }

    }

    public static class GEventTypes 
    {
        private static GEventType s_Click = new GEventType("'click'");
        public static GEventType Click { get { return s_Click; } }


        private static GEventType s_dblclick = new GEventType("'dblclick'");
        public static GEventType DblClick { get { return s_dblclick; } }

        /*
'mouseup'
'mousedown'
'mouseover'
'mouseout'*/
               
    }
}
